<!--
公告中心列表
 add by yyp 2019-05-13
-->
<template lang="pug">
  keep-alive
    kalix-table(bizKey="NoticeCenter" title='公告中心列表' ref="kalixTable"
    v-bind:tableFields="tableFields"
    v-bind:targetURL="NoticeCenterURL"
    v-bind:bizDialog="noticecenterDialog"
    v-bind:btnList="noticecenterBtnList"
    v-bind:toolbarBtnList="toolbarBtnList"
    bizSearch="noticecenterSearch")
      template(slot="tableColumnSlot")
        el-table-column(prop="noticeType" label="公告类别" align="center")
        el-table-column(prop="noticeTitle" label="公告标题" align="center")
        el-table-column(prop="noticeDate" label="公告日期" align="center")
          template(slot-scope="scope")
            span {{dataFormat(scope.row.noticeDate)}}
        el-table-column(prop="noticeDetails" label="公告详情" align="center")
</template>

<script type="text/ecmascript-6">
  import {NoticeCenterURL} from '../../config.toml'
  import {noticecenterConfigBtnList} from './config'
  import KalixTable from '../../../../../components/corelib/components/common/baseTable'

  export default {
    name: 'kalix-mooc-noticecenter',
    components: {KalixTable},
    data() {
      return {
        NoticeCenterURL: NoticeCenterURL,
        tableFields: [
        ],
        noticecenterDialog: [
          {id: 'add', dialog: 'noticecenterAdd'},
          {id: 'edit', dialog: 'noticecenterEdit'},
          {id: 'view', dialog: 'noticecenterView'}
        ],
        noticecenterBtnList: noticecenterConfigBtnList,
        toolbarBtnList: [
          {id: 'add', isShow: true, title: '添加', icon: 'icon-pinleizengjia', isPermission: true}
        ]
      }
    },
    methods: {
      dataFormat(val) {
        let d = new Date(val)
        return this.$M_FormatDate(d, 'yyyy-MM-dd')
      }
    }
  }
</script>

<style scoped lang="stylus">

</style>
